<template>
  <div class="ListPape">
    <div class="title">列表页</div>
    <div class="newRelease">最新发布</div>
    <ul>
    	<li v-for="lists in list" @click='savaHeader(lists)'>
    		<router-link :to="'/Details/'+lists.id">
          <div class="list_title" >
      			<span class="first_icon">{{ lists.title }}</span>
          </div>
      		<div>
      			<span>作者：{{ lists.author }}</span>
      			<span>发表时间：{{ lists.createTime | filterTime }}</span>
      			<span>发布：{{ lists.isRelease }}</span>
      			<span>阅读：{{ lists.red_num }}</span>
      		</div>
        </router-link>        
    	</li>
    </ul>
    <tabSelect></tabSelect>
  </div>
</template>
<script>

import tabSelect from './smallPage/TabSelect'
export default {

  data () {

    return {
      list : []
    }

  },

  created() {
  	this.axios.get('/article/allRelease')
  	.then((data)=>{
  		this.list = data.data.data
  	})
  },

  methods: {
      savaHeader(lists){
        this.$store.dispatch('savaHeader', lists)
      }
  },

  watch: {
      
     

  },

  components:{
    tabSelect
  }

}

</script>

<!-- Add "scoped" attribute to limit CSS to this components only -->
<style lang="scss" scoped>
  @function rem($px){
    @return ($px/75)+rem;
  }
  
  .ListPape {
    .title{
      text-align: center;
      line-height:rem(90);
      font-size:rem(30);
      background-color:#000;
      color:#fff;
      text-shadow: 0 0 2px #fff;
    }

    .newRelease{
      line-height: rem(50);
      border-bottom:1px solid #eaeaea;
      padding: 6px 12px;
      background-color: #F7F7F7;
      font-size:rem(28);
      color:#333;
    }

    ul{
      padding-bottom: rem(20);
      li{
        line-height: rem(60);
        padding:rem(10) rem(30);
        border-bottom:1px solid #ddd;
        .first_icon{
          font-size:rem(28);
        }
        span{
          font-size:rem(24);
        }
      }
    }
  }
  
  










</style>
